$(document).ready(function () {
   szysy.onload();
})

var szysy = (function () {

    var init = function () {
		
    }

    return {
        onload : function () {
            init();
//          szysy.windowResize();
            szysy.dateShow();
            szysy.tableDate()
        },
        /*页面表格数据*/
       	tableDate:function(){
	    	var data = [
	    		{
	 				"number": "01",
	 				"waterResouceNum": "500",
	 				"dateStart": "2018-11-30",
	 				"dateEnd": "2018-12-30",
	 				"operation": null
	 			},
	 			{
	 				"number": "02",
	 				"waterResouceNum": "3",
	 				"dateStart": "2018-10-30",
	 				"dateEnd": "2018-12-30",
	 				"operation": null
	 			}
	 		];
	 		$('#wxlSzysy').DataTable({
	 			"data": data,
	 			"columnDefs": [{
	 					"targets": -1,
	 					"data": null,
	 					"render": function(data, type, full, meta) {
	 						return '<a href="szy_formBg.html"><span class="btn wxl_bg_yel">变更</span></a>'
	 					}
	 				},
	 				{
	 					'targets': 0,
	 					'className': 'dt-body-center',
	 					'render': function(data, type, row) {
	 						return '<input class="checkchild" type="checkbox"/>';
	 					}
	 				}
	 			],
	 			"columns": [
	 			    {
	 					"data": "btn"
	 				},
	 			    {
	 					"data": "number"
	 				},
	 				{
	 					"data": "waterResouceNum"
	 				},
	 				{
	 					"data": "dateStart"
	 				},
	 				{
	 					"data": "dateEnd"
	 				},
	 				{
	 					"data": "operation"
	 				}
	 			],
	// 			"paging": false,
	 			"info": false,
	 			"lengthChange": false,
	 			"searching": false
	 		})
	    },
       //页面缩放效果
       windowResize:function(){
	       	var content_xxcj_h=$(document).height()-20;
			$(".wxl_cztdsy").css("height",content_xxcj_h+"px");
			$(window).resize(function(){
				$(".wxl_cztdsy").css("height",content_xxcj_h+"px");
			});
       },
       //日期显示
       dateShow:function(){
       	 layui.use('laydate', function(){
			  var laydate = layui.laydate;
			  laydate.render({
				    elem: '#wxl_date1'
				    ,theme: 'molv'
			 });
			})
       	 layui.use('laydate', function(){
			  var laydate = layui.laydate;
			  laydate.render({
				    elem: '#wxl_date2'
				    ,theme: 'molv'
			 });
			})
       }
        
    }
})();
